function [ out ] = auto_encode( data , trgt_dim ,limit)
  % auto_encode: Short description
  %
  % Extended description

  [data_size,data_dim] = size(data);

  w_ih = rand(data_dim+1,trgt_dim);
  w_ho = rand(trgt_dim+1,data_dim);

  out = train(data,w_ih,w_ho);

end  % auto_encode

function [ o_s ] = train( data,w_ih,w_ho )
% train: Short description
%
% Extended description
  [data_size,data_dim] = size(data);

  % 计算隐藏层调用sigmoid前的值
  h = [data,ones(data_size,1)] * w_ih;
  % 计算隐藏层调用sigmoid后的值及导数
  h_s = sigmoid(h);
  h_sd = sigmoid(h,1);

  % 计算结果层调用sigmoid前的值
  o = [h_s,ones(data_size,1)] * w_ho;
  % 计算结果层调用sigmoid后的值及导数
  o_s = sigmoid(o);
  o_sd = data + sigmoid(o,3);

  d_w_ho = zeros(size(w_ho));
  d_w_ih = zeros(size(w_ih));

  for i = 1:data_size
    
  end



end  % train
